summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2022-11-28 22:08:18 +0100
committerLioncash <mathew1800@gmail.com>2022-11-28 22:08:21 +0100
commit7a329ae56cb481891caeef08304756db8d903564 (patch)
tree0631a60efb88584f755a31d98dc5a28e4a4cad67
parentsyncpoint_manager: Reduce number of bounds checks (diff)
downloadyuzu-7a329ae56cb481891caeef08304756db8d903564.tar
yuzu-7a329ae56cb481891caeef08304756db8d903564.tar.gz
yuzu-7a329ae56cb481891caeef08304756db8d903564.tar.bz2
yuzu-7a329ae56cb481891caeef08304756db8d903564.tar.lz
yuzu-7a329ae56cb481891caeef08304756db8d903564.tar.xz
yuzu-7a329ae56cb481891caeef08304756db8d903564.tar.zst
yuzu-7a329ae56cb481891caeef08304756db8d903564.zip
-rw-r--r--src/core/hle/service/nvdrv/core/syncpoint_manager.cpp4
-rw-r--r--src/core/hle/service/nvdrv/core/syncpoint_manager.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/core/hle/service/nvdrv/core/syncpoint_manager.cpp b/src/core/hle/service/nvdrv/core/syncpoint_manager.cpp
index 8d14116d5..aba51d280 100644
--- a/src/core/hle/service/nvdrv/core/syncpoint_manager.cpp
+++ b/src/core/hle/service/nvdrv/core/syncpoint_manager.cpp
@@ -63,7 +63,7 @@ void SyncpointManager::FreeSyncpoint(u32 id) {
syncpoint.reserved = false;
}
-bool SyncpointManager::IsSyncpointAllocated(u32 id) {
+bool SyncpointManager::IsSyncpointAllocated(u32 id) const {
return (id <= SyncpointCount) && syncpoints[id].reserved;
}
@@ -72,7 +72,7 @@ bool SyncpointManager::HasSyncpointExpired(u32 id, u32 threshold) const {
if (!syncpoint.reserved) {
ASSERT(false);
- return 0;
+ return false;
}
// If the interface manages counters then we don't keep track of the maximum value as it handles
diff --git a/src/core/hle/service/nvdrv/core/syncpoint_manager.h b/src/core/hle/service/nvdrv/core/syncpoint_manager.h
index b76ef9032..4f2cefae5 100644
--- a/src/core/hle/service/nvdrv/core/syncpoint_manager.h
+++ b/src/core/hle/service/nvdrv/core/syncpoint_manager.h
@@ -44,7 +44,7 @@ public:
/**
* @brief Checks if the given syncpoint is both allocated and below the number of HW syncpoints
*/
- bool IsSyncpointAllocated(u32 id);
+ bool IsSyncpointAllocated(u32 id) const;
/**
* @brief Finds a free syncpoint and reserves it